package zky410;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class sads {
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String[] s = bf.readLine().split(" ");
        int [] num = new int[s.length];
        for (int i = 0; i < s.length; i++) {
            num[i] = Integer.parseInt(s[i]);
        }
        int[][] mi = new int[num[0]][num[1]];
       for (int i = 0; i < num[0]; i++) {
            String[] split = bf.readLine().split(" ");
            for (int j = 0; j < num[1]; j++) {
                mi[i][j] = Integer.parseInt(split[j]);
            }
        }
        int k = num[2]; //表示k秒
        int x = num[3]-1; //表示在迷宫中的x行
        int y = num[4]-1; //表示在迷宫中的y列
        int res = 0;  //初始财富值为0
        int i = find(mi, k, x, y, x, y, res);
        System.out.println(i);

    }
    //num 为迷宫，k为时间
    //n,m为运动的点，x，y为初始的位置，res为宝藏值
    public static int find(int[][] num,int k,int n,int m,int x,int y,int res){
        //判断是否在表格中
        if(!inArea(num,n,m)){
            return res;
        }
        //如果遇到障碍就返回
        if(num[n][m] == -1){
            return res;
        }
        //判断能否返回
        if(cal(x,y,n,m)>k){
            return res;
        }
        res += num[n][m];
        num[n][m] = 0;
        int a = find(num,k-1,n,m,x,y,res);//原地不动
        int b = find(num,k-1,n-1,m,x,y,res);//接下来是四个方向
        int c = find(num,k-1,n+1,m,x,y,res);
        int d = find(num,k-1,n,m-1,x,y,res);
        int e = find(num,k-1,n,m+1,x,y,res);

        return Math.max(Math.max(Math.max(Math.max(a,b),c),d),e);

    }
    //计算与原点的距离
    static int cal(int x,int y,int n,int m){
        return Math.abs(x-n)+Math.abs(y-m);
    }
    //判断是不是在范围内
   static boolean inArea(int[][] num,int x,int y){
        return 0<= x && x< num.length
                && 0<=y && y< num[0].length;
    }
}